import java.math.BigDecimal;
import java.util.Calendar;

public class Expense extends Item{
	
	private BigDecimal amt;
	private Category category;
	private PaymentMethod paymentMethod;
	
	public Expense(String description, Calendar date, 
			BigDecimal amt, String category, String paymentMethod,int index) {
		super(description, date,index);
	
		setAmt(amt);	
		setCategory(category);
		setPaymentMethod(paymentMethod);
	}
	
	public void set(String description, Calendar date, BigDecimal amt, String category, String paymentMethod){
		super.set(description, date);
		setAmt(amt);
		setCategory(category);
		setPaymentMethod(paymentMethod);
	}
	
	public BigDecimal getAmt() {
		return amt;
	}

	public void setAmt(BigDecimal amt) {
		this.amt = amt;
	}
	
	public String getCategory() {
		return category.toString();
	}

	public void setCategory(String newCategory) {
		category=Category.valueOf(newCategory.toUpperCase());
		
	}

	public String getPaymentMethod() {
		return paymentMethod.toString();
	}

	public void setPaymentMethod(String newPaymentMethod) {
		if(newPaymentMethod.equals("Credit Card"))
			paymentMethod=PaymentMethod.valueOf("CREDIT");
		else paymentMethod=PaymentMethod.valueOf(newPaymentMethod.toUpperCase());
	}

}